package com.biz.primus.ms.commodity.trans;

import com.biz.primus.commodity.vo.backend.ProductVo;
import com.biz.primus.ms.commodity.dao.po.Product;
import com.google.common.base.Function;

import javax.annotation.Nullable;

/**
 * @author wanzhong
 */
public class Product2ProductVo implements Function<Product,ProductVo>{

    @Nullable
    @Override
    public ProductVo apply(@Nullable Product p) {
        ProductVo pv = new ProductVo();
        pv.setId(p.getId().toString());
        pv.setVendorId(p.getVendorId());
        pv.setName(p.getName());
        pv.setSubTitle(p.getSubTitle());
        pv.setProductCode(p.getProductCode());
        pv.setBreif(p.getBreif());
        pv.setBrandId(p.getBrandId());
        pv.setCategoryId(p.getCategoryId());
        pv.setLogo(p.getLogo());
        pv.setImages(p.getImages());
        pv.setIsRapidProduct(p.getIsRapidProduct());
        return pv;
    }
}
